#ifndef GAME_H
#define GAME_H

#include "level.h"
#include "QFile"
#include <QStringList>
#include "savedgameslist.h"

class Game
{
public:
    Game();
    ~Game();

    Level *getCurrentLevel() const;
    QString getLevelAt(int pos);
    Map *getCurrentMap() const;
    Player *getCurrentPlayer() const;
    QStringList getSavedGamesToString();

    void setCurrentLevel(Level *level);
    void setSavePath(QString path);
    void setLevelPath(QString path);

    void addLevel(QString filePath);
    void removeLevel(int pos);
    void nextLevel();
    void saveLevel(QString filePath);
    void loadLevel(QString filePath);
    void saveGame(QString name, int pos);
    void loadGame(int pos);
    void newGame(QStringList levels);
    void endGame();
    void removeSavedGame(int pos);
    void collisionsWithPlayer();
    void movePlayerLeft();
    void movePlayerUp();
    void movePlayerRight();
    void movePlayerDown();
    void advance(bool &winLevel, bool &winGame, bool &loose);
    void draw(QPainter *painter);

private:
    Level *m_currentLevel;
    int m_currentPos;
    QStringList m_levels;
    QString m_levelPath;
    QString m_savePath;
    SavedGamesList m_savedGames;

};

#endif // GAME_H
